import axios from './axios'

export const getUsers = (param) => {
    return axios.request({
        url: '/user/getUsers',
        method: 'get',
        params: param
    })
}

export const delUser = (param) => {
    return axios.request({
        url: '/user/' + param,
        method: 'delete'
    })
}

export const addUser = (param) => {
    return axios.request({
        url: '/user/save',
        method: 'post',
        data: param
    })
}

export const updateUser = (param) => {
    return axios.request({
        url: '/user/update',
        method: 'post',
        data: param
    })
}

export const updateUserPwd = (oldPassword, newPassword) => {
    return axios.request({
        url: '/user/updateUserPwd/' + oldPassword + '/' + newPassword,
        method: 'get'
    })
}

export const avatarChange = (param) => {
    return axios.request({
        url: '/user/avatar',
        method: 'post',
        data: param
    })
}
